/**
 * 
 */
package org.dragonfire.parser.functions;

import org.dragonfire.parser.Equation;
import org.dragonfire.util.DMath;

/**
 * @author Darth Android
 * @date Jul 30, 2006
 */
public class Round extends Function {

	public String eval(Equation equ, String[] params) {
		int places = 0;
		double number = toDouble(params[0]);
		if (params.length > 1)
			places = (int) toDouble(params[1]);
		return DMath.round(number, places) + "";
	}

	public int minParams() {
		return 1;
	}
}
